<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>用户信息</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <a style="position: absolute;font-size: 50px;margin-left: 10px;margin-top: 10px;" class="layui-icon layui-icon-return" id="return"></a>
        <div class="layui-logo" style="margin-left: 50px;">我的信息</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img class="layui-nav-img" th:src="@{'..'+${session.user.faceImage}}">
                    <span th:text="${session.user.username}" id="username"></span>
                    <span style="opacity: 0;" th:text="${session.user.id}" id="uid"></span>
                </a>
            </li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll" id="test1">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">我的信息</a>
                    <dl class="layui-nav-child">
                        <dd><a href="../templates/userVideo.html" th:href="@{/userInfo/userVideo}" target="ifr">视频列表</a></dd>
                        <dd><a href="../templates/userFan.html" th:href="@{/userInfo/userFan}" target="ifr">关注列表</a></dd>
                        <dd><a href="../templates/userColl.html" th:href="@{/userInfo/userColl}" target="ifr">收藏列表</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe src="../templates/main.html" th:src="@{/userInfo/main}" style="width: 100%;height: 98%;" name="ifr"></iframe>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        <div style="margin: 0px;">© 计算机学院11703060219@cqut.com</div>
    </div>
</div>
<script src="../layui/layui.js"></script>
<script src="../js/userInfo.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

        //获取hash来切换选项卡，假设当前地址的hash为lay-id对应的值
        var layid = location.hash.replace(/^#test1=/, '');
        element.tabChange('test1', layid); //假设当前地址为：http://a.com#test1=222，那么选项卡会自动切换到“发送消息”这一项

        //监听Tab切换，以改变地址hash值
        element.on('tab(test1)', function(){
            location.hash = 'test1='+ this.getAttribute('lay-id');
        });
    });
</script>

</body>
</html>